package net.starwifi.duobao.service.impl;

import net.starwifi.duobao.entity.Role;
import net.starwifi.duobao.service.BaseServiceImpl;
import net.starwifi.duobao.service.RoleService;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by ruo on 2015/4/2.
 */
@Service
public class RoleServiceImpl extends BaseServiceImpl<Role,Long> implements RoleService {


    @Override
    @Transactional
    @CacheEvict(value = "authorization", allEntries = true)
    public void save(Role role) {
        super.save(role);
    }

    @Override
    @Transactional
    @CacheEvict(value = "authorization", allEntries = true)
    public Role update(Role role) {
        return super.update(role);
    }


    @Override
    @Transactional
    @CacheEvict(value = "authorization", allEntries = true)
    public Role update(Role entity, String... ignoreProperties) {
        return super.update(entity, ignoreProperties);
    }

    @Override
    @Transactional
    @CacheEvict(value = "authorization", allEntries = true)
    public void delete(Long id) {
        super.delete(id);
    }

    @Override
    @Transactional
    @CacheEvict(value = "authorization", allEntries = true)
    public void delete(Long... ids) {
        super.delete(ids);
    }

    @Override
    @Transactional
    @CacheEvict(value = "authorization", allEntries = true)
    public void delete(Role role) {
        super.delete(role);
    }
}
